-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Feat: add oauth2 support for Jira toolkit #30684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add oauth2 support for Jira toolkit #30684
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -14,6 +14,7 @@ class JiraAPIWrapper(BaseModel): | |||
confluence: Any = None | |||
jira_username: Optional[str] = None | |||
jira_api_token: Optional[str] = None | |||
jira_oauth_dict: Optional[Union[Dict[str, Union[str, Dict[str, str]]], str]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dict
isn't a good thing to put in this variable name. Perhapsjira_oauth2
to indicate it's just proxying theoauth2
variable?- Could you document inline what values are accepted? And explicit type annotation for the dict using a TypedDict (
typing_extensions import TypedDict
) would help! - Now that there's more than one option to authenticate, it would be good to document this as part of the wrapper -- you could add an authentication example in the JiraAPIWrapper and inline a doc-string for both variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it what you had in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! happy to merge after:
- update variable name
- adding documentation
"""Jira OAuth2 token type ('bearer' or other).""" | ||
|
||
|
||
class JiraOauth2(TypedDict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typing_extensions.TypedDict might be needed w/ pydantic and python < 3.12
Description: add support for oauth2 in Jira tool by adding the possibility to pass a dictionary with oauth parameters. I also adapted the documentation to show this new behavior